<template>
 <post-list-item v-for="item in data" :post-info="item"/>
</template>
<script setup>
import {ref} from "vue";
import PostListItem from "@/views/system/post/component/PostListItem.vue";
import {postPage} from "@/views/system/post/js/PostRequest.js";

onMounted(() => {
  getPage()
})
const data = ref([])
const page = ref({
  total: 0,
  currentPage: 1,
  pageSize: 10
})

const getPage = (newPage = page.value.currentPage, newSize = page.value.pageSize) => {
  postPage({
    pageNum: newPage,
    pageSize: newSize
  }).then(res => {
    if (res.success) {
      page.value.total = res.data.totalRow
      data.value = res.data.records
    }
  }).finally(() => {
  })
}
</script>
<style scoped>

</style>